#!/bin/bash


git pull
docker stop server-fresh
docker rm server-fresh
docker rmi server-fresh:prod
cd /opt/fresh/server-fresh/
docker build -t server-fresh:prod .
docker run -itd --name server-fresh -p 5101:5101 -v /opt/fresh/server-fresh/:/usr/src/server-fresh --restart=always  --network my-net server-fresh:prod
docker start mysql-test
docker start server-fresh

 docker run \
 --restart=always \
 --name fresh-mysql \
 -v /opt/fruit/logs:/logs \
 -v /opt/fruit/data:/var/lib/mysql \
 -p 3306:3306  \
 --network my-net \
 -e MYSQL_ROOT_PASSWORD=Lexiangmili1688 \
 -d mysql:latest

 docker run -itd --name server-fresh \
 -p 5101:5101 \
 -v /opt/fresh/server-fresh:/usr/src/server-fresh \
 --restart=always \
 --network my-net server-fresh:prod
 
   docker run \
 --restart=always \
 --name fresh-redis \
 -p 6379:6379  \
  --network my-net  \
 -d redis:latest \
  --requirepass ''